package tech.wangpai.service.impl;

import org.springframework.stereotype.Service;
import tech.wangpai.domain.User;
import tech.wangpai.repository.UserMapper;
import tech.wangpai.service.UserService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    public UserMapper repository;

    @Override
    public List<User> queryUser(String username) {
        return repository.queryUserByUsername(username);
    }

    @Override
    public User getUserById(String userId) {
        return repository.getUserById(userId);
    }

    @Override
    public void addUser(User user) {
        repository.addUser(user);
    }

    @Override
    public void delUserById(String userId) {
        repository.delUserById(userId);

    }

    @Override
    public void updateUserById(String userId, User user) {
        repository.updateUserById(userId,user);
    }

    @Override
    public void updateUserAgeById(String userId, Integer age) {
        repository.updateUserAgeById(userId,age);
    }
}
